home *** CD-ROM | disk | FTP | other *** search
/ World of Education / World of Education.iso / world_p / pcshx10b.zip / PCSHX10B.EXE / GNUFGREP.EXE / GREPDOCS.EXE / MSDOSMAC.H < prev    next >
Text File  |  1990-08-06  |  616b  |  28 lines

  1. /*
  2.  * The macro EXTRACT_PROGRAM_NAME(p) converts an MSDOS style argument 0
  3.  * full path program name to a nice, Un*x style argument 0 program name.
  4.  */
  5. #define EXTRACT_PROGRAM_NAME(p)        \
  6.     {                    \
  7.     char *q, *strchr(), *strrchr();    \
  8.     if (q = strrchr(p, '\\'))    \
  9.         p = q + 1;            \
  10.     if (q = strchr(p, '.'))        \
  11.         *q = '\0';            \
  12.     strlwr(p);            \
  13.     }
  14.  
  15.  
  16.  
  17. /*
  18.  * The macro CONVERT_TO_SLASHES(p) converts all backslashes in a pathname
  19.  * to forward slashes.
  20.  */
  21. #define CONVERT_TO_SLASHES(p)        \
  22.     {                    \
  23.     char    *q;            \
  24.     for (q = p; *q; ++q)        \
  25.         if (*q == '\\')        \
  26.         *q = '/';        \
  27.     }
  28.